home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Tools - Objects / MacApp / MacApp 2.0 CD Release / MacApp® 2.0 Tutorial / Chapter 07 / UIconEdit.p < prev   
Encoding:
Text File  |  1990-03-27  |  2.3 KB  |  94 lines  |  [TEXT/MPS ]

  1. {Copyright © 1989 by Apple Computer, Inc.  All rights reserved.}
  2.  
  3. UNIT UIconEdit;
  4.  
  5.  
  6. INTERFACE
  7.  
  8.  
  9. USES
  10.     { • MacApp }
  11.     UMacApp,
  12.     
  13.     { • Toolbox }
  14.     ToolUtils; 
  15.     
  16.     
  17. CONST kSignature = 'ICED';
  18.       kFileType = 'IDOC'; 
  19.  
  20.  
  21. TYPE 
  22.     TIconApplication = OBJECT(TApplication)
  23.  
  24.         PROCEDURE TIconApplication.IIconApplication(iconFileType: OSType);
  25.             {Initializes the application and globals.}
  26.  
  27.         FUNCTION  TIconApplication.DoMakeDocument(itsCmdNumber: CmdNumber): TDocument; OVERRIDE;
  28.             { Creates a document of type TIconDocument and returns a reference to it.}
  29.  
  30.     END;
  31.  
  32.  
  33.     TIconDocument = OBJECT(TDocument)
  34.     
  35.         fIconBitMap:        TIconBitMap;        { The document’s icon object. }
  36.  
  37.  
  38.         PROCEDURE TIconDocument.IIconDocument;
  39.             { Initializes the document. }
  40.  
  41.         PROCEDURE TIconDocument.Free; OVERRIDE;
  42.             { Frees allocated memory when the document is closed. }
  43.  
  44.         PROCEDURE TIconDocument.DoInitialState; OVERRIDE;
  45.             { Sets the document's data to represent a "new" document. }
  46.  
  47.         PROCEDURE TIconDocument.DoMakeViews(forPrinting: boolean); OVERRIDE;
  48.             { Creates the windows to display the document's data. }
  49.  
  50.     END;
  51.     
  52.     
  53.     TIconBitMap = OBJECT(TObject)
  54.  
  55.         fDataHandle:    Handle;                { Handle to the icon's bit map.            }
  56.  
  57.         PROCEDURE TIconBitMap.IIconBitMap;
  58.             { Initialize the IconBitMap object and allocate space for its data. }
  59.  
  60.         PROCEDURE TIconBitMap.Free; OVERRIDE;
  61.             { Free the icon's bit map. }
  62.             
  63.         PROCEDURE TIconBitMap.SetIconBitMap(theBitMap : Handle);
  64.             { Set the contents of the icon bit map to the new bit map. }
  65.             
  66.         PROCEDURE TIconBitMap.Clear;
  67.             { Clear the icon map by setting its bits to zero. }
  68.             
  69.         PROCEDURE TIconBitMap.Invert;
  70.             { Invert the icon's bit map. }
  71.             
  72.         PROCEDURE TIconBitMap.IconBitToWordBit (iconBit: Point; VAR word, bit: INTEGER);
  73.             { Convert icon bit numbers to the corresponding word and bit number. }
  74.             
  75.         FUNCTION TIconBitMap.GetBit(iconBit: Point): BOOLEAN;
  76.             { Return the state of the given bit. }
  77.             
  78.         PROCEDURE TIconBitMap.SetBit(iconBit: Point; turnBitOn: BOOLEAN);
  79.             { Set the state of the given bit as indicated. }
  80.  
  81.         FUNCTION TIconBitMap.Copy: TIconBitMap;
  82.             { Create a new icon object which is a copy of itself. }
  83.             
  84.         PROCEDURE TIconBitMap.CopyDataTo (anIcon: TIconBitMap);
  85.             { Copy icon data to an existing icon object. }
  86.             
  87.     END;
  88.  
  89.  
  90. IMPLEMENTATION
  91.  
  92.     {$I UIconEdit.inc1.p}
  93.  
  94. END.